package com.mobile.collect.present;

import com.mobile.collect.activitys.UploadListActivity;
import com.mobile.collect.beans.ExportInfo;
import com.mobile.collect.db.EntityManager;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * 类名: UploadListPresent
 * 作者: 李学伟
 * 日期: 2020年10月10日 11:10
 * 描述:
 */
public class UploadListPresent extends BasePresent<UploadListActivity>{

    public void queryList(){
        List<ExportInfo> list = EntityManager.getInstance().queryExportInfo();
        sort(list);
        getV().onSuccess(list);
    }
    private void sort(List<ExportInfo> list){
        Collections.sort(list, new Comparator<ExportInfo>() {
            @Override
            public int compare(ExportInfo a, ExportInfo b) {
                return b.getExportTime().compareTo(a.getExportTime());
            }
        });
    }

}
